#pragma once

#include "master.h"

//--------------------------------------------------------------------------------------------------
// gameSystem.h - Game systems are components that can be added to the main program loop
//					and have their own update, render and I/O functionality.
//					examples include the Console system, and the main game loop.
//--------------------------------------------------------------------------------------------------

class gameSystem
{

public:
	virtual void setup() {}
	virtual void update(float timeDelta) = 0;
	virtual void draw() {}
	virtual void exit() {}

	// This is for consoles, is called after the standard draw loop
	virtual void drawOverlay() {};

	virtual void keyPressed		(int key) {}
	virtual void keyReleased	(int key) {}

	virtual void mouseMoved		(int x, int y){}
	virtual bool mouseDragged	(int x, int y, int button){return false;}
	virtual bool mousePressed	(int x, int y, int button){return false;}
	virtual void mouseReleased	(int x, int y, int button){}

	virtual void windowResized (int w, int h) {}

};

//--------------------------------------------------------------------------------------------------

void gameSystem_register(gameSystem* system);

void gameSystem_updateAll();
void gameSystem_setupAll();
void gameSystem_drawAll();
void gameSystem_exitAll();

void gameSystem_windowResized	(int w, int h);

void gameSystem_keyPressed		(int key);
void gameSystem_keyReleased		(int key);

void gameSystem_mouseMoved		(int x, int y);
void gameSystem_mouseDragged	(int x, int y, int button);
void gameSystem_mousePressed	(int x, int y, int button);
void gameSystem_mouseReleased	(int x, int y, int button);
